Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use unveil(2) on OpenBSD #1194

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

klemensn
Copy link
Contributor

After #1175 removed ioctl(2) fallback code shelling out to ifconfig(8), there is no code left (compiled on OpenBSD) that would fork(2) or execve(2).

Drop the ability to run any executable file to double down on this, thus reducing the attack surface of this this experimental, internet facing daemon running as root.

pledge(2) is doable, but needs more polish.
unveil(2), however, is as simple as it gets.

On other systems, this code is a NOOP, but can still help to implement similar safety belts.

@klemensn
Copy link
Contributor Author

Like #1193, this adds https://pkg.go.dev/suah.dev/protect to go.{mod,sum}, so iff either of the two PRs get merged, the other needs updating.

After yggdrasil-network#1175 removed ioctl(2) fallback code shelling out to ifconfig(8),
there is no code left (compiled on OpenBSD) that would fork(2) or execve(2).

Drop the ability to run any executable file to double down on this, thus
reducing the attack surface of this this experimental, internet facing
daemon running as root.

pledge(2) is doable, but needs more polish.
unveil(2), however, is as simple as it gets.

On other systems, this code is a NOOP, but can still help to implement
similar safety belts.
@klemensn
Copy link
Contributor Author

klemensn commented Nov 3, 2024

@neilalexander Thoughts?

I've been running this together with pledge and privilege drop to a dedicated user for weeks now without issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant